﻿<!doctype html>
<html>
<head>
<title></title>
<vt:include file="inc/meta.inc" />
<link href="Styles/TestView.css?ver={$version}" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="Scripts/TestView.js?ver={$version}"></script>
<script type="text/javascript" src="/Utility/CoreScripts/highcharts.js?ver={$version}"></script>
<script type="text/javascript" src="/Utility/CoreScripts/highcharts-3d.js?ver={$version}"></script>
</head>
<body>
<div class="pagerTitle">《{$result.tp_name}》测试结果！</div>
<div class="info"> 亲爱的 <b>
  <vt:if var="st.ac_id" value="0" compare=">"> {$st.ac_name}
    <vt:else/>
    匿名考生</vt:if>
  </b> ，您于<b>{$result.Tr_crtTime format="yyyy-MM-dd HH:mm"}</b>的测试成绩，详情如下： </div>
<div class="scoreinfo"> 得分：<span class="score">{$result.Tr_Score}分</span>；当前测试总分<span class="total">{$pager.Tp_Total}分</span>，及格分<span class="pass">{$pager.Tp_PassScore}分</span>； </div>
<div id="details">
  <table width="90%" border="1" cellspacing="0" id="detailsTable" cellpadding="0">
    <tr class="header">
      <th>题型</th>
      <th>试题数</th>
      <th>答题数</th>
      <th>答对题数</th>
      <th>答错的题数</th>
      <th>题型总分</th>
      <th>得分</th>
    </tr>
    <vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
      <tr class="itemrow">
        <td><!--试题类型 -->
          
          <vt:function var="typeName" method="getTypeName" args="$#.data.TPI_Type"/>
          {$:i}.{$:#.typeName}</td>
        <td><!--当前试题类型的试题数 --> 
          {$:#.data.TPI_Count}</td>
        <td><!--答题数 -->
          
          <vt:function var="typeCount" method="getAnswerCount" args="$#.data.TPI_Type"/>
          {$:#.typeCount} </td>
        <td><!--答对的数目 -->
          
          <vt:function var="typeSuccessCount" method="getSucessCount" args="$#.data.TPI_Type"/>
          {$:#.typeSuccessCount}</td>
        <td><!--答错的数目 -->
          
          <vt:function var="typeErrorCount" method="getErrorCount" args="$#.data.TPI_Type"/>
          {$:#.typeErrorCount}</td>
        <td>{$:#.data.TPI_Number}</td>
        <td><!--得分 -->
          
          <vt:function var="typeNumber" method="getTypeNumber" args="$#.data.TPI_Type"/>
          {$:#.typeNumber} </td>
      </tr>
    </vt:foreach>
    <tr class="sum">
      <td>总计：</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td style="color:Red">&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
  <script>
$(function () {
    $('#highchart').highcharts({
        chart: {
            type: 'column'
        },
        title: {
            text: '答题详情回顾'
        },
        subtitle: {
            text: ''
        },
        xAxis: {
            categories: [
			<vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
                <vt:function var="typeName" method="getTypeName" args="$#.data.TPI_Type"/>
				'{$:#.typeName}',				
                </vt:foreach>
            ]
        },
        yAxis: {
            min: 0,
            title: {
                text: '数量'
            }
        },
        tooltip: {
            headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
            pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
                '<td style="padding:0"><b>{point.y} </b></td></tr>',
            footerFormat: '</table>',
            shared: true,
            useHTML: true
        },
        plotOptions: {
            column: {
                pointPadding: 0.2,
                borderWidth: 0
            }
        },
        series: [{
            name: '题量',
            data: [
			 <vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
			{$:#.data.TPI_Count},</vt:foreach>
			]
        },{
            name: '答题数',
            data: [
			<vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
			<vt:function var="typeCount" method="getAnswerCount" args="$#.data.TPI_Type"/>
          {$:#.typeCount} ,</vt:foreach>]
        },{
            name: '答对数',
            data: [
			<vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
			<vt:function var="typeSuccessCount" method="getSucessCount" args="$#.data.TPI_Type"/>
          {$:#.typeSuccessCount},</vt:foreach>]
        }]
    });
});							
</script>
  <!--<div id="highchart" style="width:90%;height:300px; margin-left:auto; margin-right:auto"></div>-->
</div>
<!--答题详情展示区 -->
<div id="quesBox">
  
  <div id="highchart2" style="height:300px;margin-left:auto; margin-right:auto;"></div>
  <div id="quesTitle">
    <div id="quesBtnBox">
      <div id="btnAll" class="btn">显示所有</div>
      <div id="btnSuccess" class="btn">只显示正确</div>
      <div id="btnError" class="btn">只显示错误</div>
      <div id="btnNoans" class="btn">只显示未做</div>
    </div>
  </div>
  <script>
$(function () {
    $('#highchart2').highcharts({
        chart: {
            type: 'pie',
            options3d: {
                enabled: true,
                alpha: 45,
                beta: 0
            }
        },
        title: {
            text: '答题详情回顾'
        },
		tooltip: {
			pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>'
		},
        plotOptions: {
            pie: {
                allowPointSelect: true,
                cursor: 'pointer',
                depth: 35,
                dataLabels: {
                    enabled: true,
                    format: '{point.name} '
                }
            }
        },
        series: [{
            type: 'pie',
            name: '所占百分比',
            data: [             
			['答对 '+$(".qitemBox[ansState=0]").size()+' 道',Math.floor($(".qitemBox[ansState=0]").size()/$(".qitemBox").size()*100)],
			['答错 '+$(".qitemBox[ansState=1]").size()+' 道',Math.floor($(".qitemBox[ansState=1]").size()/$(".qitemBox").size()*100)],
			['未做 '+$(".qitemBox[ansState=2]").size()+' 道',Math.floor($(".qitemBox[ansState=2]").size()/$(".qitemBox").size()*100)]
            ]
        }]

    });
});							
</script>
  
  <vt:foreach id="tpItem" from="$#.tpi" item="data" index="i" remark="当前试卷的试题大项">
    <div class="typeBox" type="{$:#.data.TPI_Type}" >
      <vt:function var="typeName" method="getTypeName" args="$#.data.TPI_Type"/>
      <div class="typeName"> 
        <!--大题的标题 --> 
        <span class="typeTax"> {$:i}</span>、{$:#.typeName}</div>
      <!--试题列表 -->
      <vt:function var="ques" method="getQues" args="$#.data.TPI_Type"/>
      <vt:foreach from="$#.ques" item="q" index="j">
        <vt:function var="ansState" method="getAnswerState" args="$#.q.qus_id" remark="计算答题的状态，0为正确，1为错误，2为未答题"/>
        <div class="qitemBox ansState{$:ansState}" ansState="{$:ansState}" qid="{$:q.qus_id}" type="{$#.data.TPI_Type}">
          <div class="qusTitle"> <span class="qTax">0</span>、{$:q.Qus_Title} </div>
          <div class="quesSelectBox"> 
            <!--单选题 -->
            <vt:if var="q.Qus_Type" value="1" compare="=">
              <vt:function var="ans" method="getItems" args="$#.q" remark="获取当前试题的选项"/>
              <vt:foreach from="$#.ans" item="an" index="n">
                <div IsCorrect="{$:an.Ans_IsCorrect}" anid="{$:an.Ans_Id}" class="item_{$:an.Ans_IsCorrect}"> <span class="order">{$:n}</span>. <span>{$:an.Ans_Context}</span> </div>
              </vt:foreach>
            </vt:if>
            <!--多选题 -->
            <vt:if var="q.Qus_Type" value="2" compare="=">
              <vt:function var="ans" method="getItems" args="$#.q" remark="获取当前试题的选项"/>
              <vt:foreach from="$#.ans" item="an" index="n">
                <div IsCorrect="{$:an.Ans_IsCorrect}" anid="{$:an.Ans_Id}" class="item_{$:an.Ans_IsCorrect}"> <span class="order">{$:n}</span>. <span>{$:an.Ans_Context}</span> </div>
              </vt:foreach>
            </vt:if>
          </div>
          <!--得分 -->
          <div class="resultBox">
            <vt:function var="score" method="getQuesScore" args="$#.q.Qus_ID" remark="试题得分"/>
            答题得分： <span class="ScoreItem">{$:score}</span> 分 </div>
          <!-- 学生实际答题内容 -->
          <div class="resultBox">
            <vt:function var="reslut" method="getResult" args="$#.q.Qus_ID" remark="学生实际答题内容"/>
            实际答题：
            <vt:if var="reslut" value="" compare="="> （没有答题）
              <vt:else/>
              <span class="resultItem">{$:reslut}</span> </vt:if>
          </div>
          <!-- 正确答案 -->
          <div class="sucessBox">
            <vt:function var="ans" method="getSucessAnswer" args="$#.q" remark="正确答案"/>
            正确答案：<span class="selectedItem"> {$ans}</span> </div>
          <!--试题解析 -->
          <div class="explainBox"> 试题解析：
            <vt:if var="q.Qus_Explain" value="" compare="="> （无）
              <vt:else/>
              {$:q.Qus_Explain} </vt:if>
          </div>
        </div>
      </vt:foreach>
    </div>
  </vt:foreach>
</div>
</body>
</html>
